package cn.edu.sju;

import java.io.BufferedOutputStream;
/**
 * 练习1
 */
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;

public class Exercise01
{
    
    public static void main(String[] args)
        throws IOException
    {
        final String PATH = "D:\\exercise01.txt";
        try (FileOutputStream fos = new FileOutputStream(PATH); BufferedOutputStream bos = new BufferedOutputStream(fos))
        {
            bos.write(10);
            bos.write(0);
            bos.write("\nWelcome\n".getBytes(StandardCharsets.UTF_8));
            bos.write("中国共产党万岁\n".getBytes(StandardCharsets.UTF_8));
        }
        catch (IOException ex)
        {
            System.out.println("输出时出错");
            ex.printStackTrace();
            
        }
        
    }
}